package com.ewzj.bigdata.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ewzj.bigdata.R;

import java.util.List;

/**
 * Created by jhd on 18/4/3.
 */

public class SexAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    private String select;

    public SexAdapter(@Nullable List<String> data, String select) {
        super(R.layout.item_sex, data);
        this.select = select;
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {

        helper.<TextView>getView(R.id.tv_sex).setText(item);
        if (item.equals(select)) {
            helper.<TextView>getView(R.id.tv_select).setVisibility(View.VISIBLE);
        } else {
            helper.<TextView>getView(R.id.tv_select).setVisibility(View.GONE);
        }
    }
}
